export default url => {
    const crud = window.$crud(url)
  
   const add = (data) => window.$axios({
    url: `datav/component`,
    method: 'post',
    data: data
  });
  
  const getObj = (id) => window.$axios({
    url: `datav/component/${id}`,
    method: 'get',
  });
  
   const update = (id,data) => window.$axios({
    url: `datav/component/${id}`,
    method: 'put',
    data: data
  });
  
  
  
   const delObj = (id) => window.$axios({
    url: `datav/component/${id}`,
    method: 'delete'
  });
  const getPage = (params) => window.$axios({
    url: `datav/component/page`,
    method: 'get',
    params:params
  })
  const get = (id) => window.$axios({
    url: `datav/component/${id}`,
    method: 'get'
  })
  
    
    return {
        ...crud,
        get,
        getPage,
        add,
        update,
        delObj,
        getObj,
  
    }
  }  